{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "00_Notebooks",
      "version": "0.3.2",
      "provenance": [],
      "collapsed_sections": [],
      "toc_visible": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    }
  },
  "cells": [
    {
      "metadata": {
        "id": "bOChJSNXtC9g",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "# Notebook Basics"
      ]
    },
    {
      "metadata": {
        "id": "rSXwaU-ptNG6",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "<img src=\"https://raw.githubusercontent.com/GokuMohandas/practicalAI/master/images/logo.png\" width=150>\n",
        "\n",
        "Welcome to the very first lesson of practicalAI. In this lesson we will learn how to work with the notebook and saving it. If you already know how to use notebooks, feel free to skip this lesson.\n",
        "\n",
        "<img src=\"https://raw.githubusercontent.com/GokuMohandas/practicalAI/master/images/colab.png\" width=150>\n",
        "\n",
        "**Note**: To run the code in this notebook, follow these steps:\n",
        "1. Sign into your Google account.\n",
        "2. Click the **COPY TO DRIVE** button on the toolbar. This will open the notebook on a new tab.\n",
        "\n",
        "<img src=\"https://raw.githubusercontent.com/GokuMohandas/practicalAI/master/images/copy_to_drive.png\">\n",
        "\n",
        "3. Rename this new notebook by removing the **Copy of** part in the title.\n",
        "4. Run the code, make changes, etc. and it's all automatically saved to you personal Google Drive.\n",
        "\n"
      ]
    },
    {
      "metadata": {
        "id": "cOEaLCZAu4JQ",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "# Types of cells"
      ]
    },
    {
      "metadata": {
        "id": "WcOgqq5xvtMn",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "Notebooks are a great visual way of programming. We will use these notebooks to code in Python and learn the basics of machine learning. First, you need to know that notebooks are made up of cells. Each cell can either be a **code cell** or a **text cell**. \n",
        "\n",
        "*   **text cells**: used for headers and paragraph text. \n",
        "*   **code cells**: user for holding code.\n",
        "\n",
        "\n"
      ]
    },
    {
      "metadata": {
        "id": "tBVFofpLutnn",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "# Creating cells\n",
        "\n",
        "First, let's make a text cell. To create a cell at a particular location, just click on the spot and create a text cell by clicking on the **➕TEXT** below the *View* button up top. Once you made the cell, click on it and type the following inside it:\n",
        "\n",
        "\n",
        "```\n",
        "### This is a header\n",
        "Hello world!\n",
        "```"
      ]
    },
    {
      "metadata": {
        "id": "iXYgZpgpYS3N",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "# Running cells\n",
        "Once you type inside the cell, press the **SHIFT** and **ENTER** together to run the cell."
      ]
    },
    {
      "metadata": {
        "id": "WKTbiBuvYexD",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "# Editing cells\n",
        "To edit a cell, double click it and you should be able to replace what you've typed in there."
      ]
    },
    {
      "metadata": {
        "id": "Jv0ZSuhNYVIU",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "# Moving cells\n",
        "Once you make the cell, you can move it with the ⬆️**CELL** and ⬇️**CELL** buttons above. "
      ]
    },
    {
      "metadata": {
        "id": "B_VGiYf8YXiU",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "# Deleting cells\n",
        "You can delete the cell by clicking on the cell and pressing the button with three vertical dots on the top right corner of the cell. Click **Delete cell**."
      ]
    },
    {
      "metadata": {
        "id": "hxl7Fk8LVQmR",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "# Making a code cell\n",
        "Now let's take the same steps as above to make, edit and delete a code cell. You can create a code cell by clicking on the ➕CODE below the *File* button up top. Once you made the cell, click on it and type the following inside it:\n",
        "\n",
        "```\n",
        "print (\"hello world!\")\n",
        "```\n",
        "\n",
        "⏰  -   It may take a few seconds when you run your first code cell."
      ]
    },
    {
      "metadata": {
        "id": "DfGf9KmQ3DJM",
        "colab_type": "code",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 34
        },
        "outputId": "f54c0555-d23d-4493-e0a7-ed448622652f"
      },
      "cell_type": "code",
      "source": [
        "print (\"hello world!\")"
      ],
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "hello world!\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "metadata": {
        "id": "GURvB6XzWN12",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "**Note:** These Google colab notebooks timeout if you are idle for more than ~30 minutes which means you'll need to run all your code cells again. "
      ]
    },
    {
      "metadata": {
        "id": "VoMq0eFRvugb",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "# Saving the notebook"
      ]
    },
    {
      "metadata": {
        "id": "nPWxXt5Hv7Ga",
        "colab_type": "text"
      },
      "cell_type": "markdown",
      "source": [
        "Go to *File* and then click on **Save a copy in Drive**. Now you will have your own copy of each notebook in your own Google Drive. If you have a [Github](https://github.com/), you can explore saving it there or even downloading it as a .ipynb or .py file."
      ]
    }
  ]
}
